# 开始菜单
def start_menu():
    tip = '''
********************* 欢迎来到蜗牛ATM *********************
********************** 请选择以下操作 *********************
****************** 1.注册  2.登录  3.退卡 *****************         
    '''
    print(tip)
    option = input("请输入你的选择：")
    if option == '1':
        from atm_1.user import reg
        reg()
    elif option == '2':
        from atm_1.user import login
        login()
    elif option == '3':
        exit("退卡成功")
    else:
        start_menu()

# 主菜单
def main_menu():
    tip = '''
***************************** 进入蜗牛ATM主菜单 *****************************
****************************** 请选择以下操作 *******************************
******************* 1. 查询   2. 取款   3. 存款   4. 转账 *******************
****************** 5. 流水  6. 修改密码   7. 返回   8. 退卡 *****************     
        '''
    print(tip)
    option = input("请输入你的选择：")
    if option == '1':
        from atm_1.account import query
        query()
    elif option == '2':
        from atm_1.account import withdraw
        withdraw()
    elif option == '3':
        from atm_1.account import deposite
        deposite()
    elif option == '4':
        from atm_1.account import transer
        transer()
    elif option == '5':
        from atm_1.account import history
        history()
    elif option == '6':
        from atm_1.user import update_pwd
        update_pwd()
    elif option == '7':
        start_menu()
    elif option == '8':
        exit('谢谢，欢迎下次光临.')
    else:
        main_menu()


if __name__ == '__main__':
    start_menu()